]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2net: convert dest field in udp-hdr to host-endian
authorVenkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>
Fri, 10 Jul 2015 09:32:47 +0000 (05:32 -0400)
committerManjunath Govindashetty <manjunath.govindashetty@oracle.com>
Fri, 16 Oct 2015 00:07:54 +0000 (17:07 -0700)
The "dest" field in the UDP-hdr of a TX skb is in network endian format.
Convert it to host endian before accessing it. The os2bmc patch,
mentioned below introduced this code.

Fixes: 760c295e0e8d ("be2net: Support for OS2BMC")
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 4ef10cfad96f68f815c5f5207b2348a6f65bd28d..bae57b07c058c0baafb510ec0d039a71e2fc9d05 100644 (file)
@@ -1254,7 +1254,7 @@ static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
        if (is_udp_pkt((*skb))) {
                struct udphdr *udp = udp_hdr((*skb));
 
-               switch (udp->dest) {
+               switch (ntohs(udp->dest)) {
                case DHCP_CLIENT_PORT:
                        os2bmc = is_dhcp_client_filt_enabled(adapter);
                        goto done;