ctdb-common: For AF_PACKET socket types, protocol is in network order
commit28e5e957a4b923329b5494fba9698a7aebd5fb96
authorAmitay Isaacs <amitay@gmail.com>
Thu, 3 Mar 2016 03:17:40 +0000 (3 14:17 +1100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 14 Mar 2016 09:02:15 +0000 (14 10:02 +0100)
tree9c072deacfe42d6efd06382e47c383412f2b87e5
parent5b424635af2455272e6d8d57c9d643ee27406658
ctdb-common: For AF_PACKET socket types, protocol is in network order

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11770

From man page of packet(7):

                                             protocol is the  IEEE  802.3
   protocol  number  in  network  byte  order.  See the <linux/if_ether.h>
   include file for a list of allowed protocols.  When protocol is set  to
   htons(ETH_P_ALL),  then all protocols are received.

Protocol argument was changed from network order to host order wrongly
in commit 9f8395cb7d49b63a82f75bf504f5f83920102b29.

Specifying "protocol" field to socket(AF_PACKET, ...) call only affects
the packets that are recevied.  So use protocol = 0 when sending raw
packets.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Mar  4 12:58:50 CET 2016 on sn-devel-144

(cherry picked from commit f5b6a5b13406c245ab9cc8c1699483af9eb21f88)
ctdb/common/system_linux.c