From: Venkat Duvvuru Date: Fri, 10 Jul 2015 09:32:47 +0000 (-0400) Subject: be2net: convert dest field in udp-hdr to host-endian X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1645d99768e00d3148ebded5d8c4ab55cdb19a5c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git be2net: convert dest field in udp-hdr to host-endian 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 Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 8ef7ea5d8f4a..c996dd76f546 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -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;