]> git.puffer.fish Git - mirror/frr.git/commit
Revert "isisd: bpf: ETHER_HDR_LEN -> ETH_ALEN" 1563/head
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 18 Dec 2017 15:19:08 +0000 (13:19 -0200)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 18 Dec 2017 15:19:08 +0000 (13:19 -0200)
commit12386e86db93502bdcd3ec6c2ae24bcef0ba8ca3
treea11521ac716a746ca06d3b3b314bc045949a7273
parentacf43bea0d927b9a223fdc92753ccf48692e0898
Revert "isisd: bpf: ETHER_HDR_LEN -> ETH_ALEN"

This reverts commit d9e5b009554f99230be1eee62daf098403c3cadf.

ETH_ALEN is not equivalent to ETHER_HDR_LEN. ETHER_HDR_LEN is the
definition for the length of the full ethernet header, meanwhile
ETH_ALEN is just the length of the ethernet address.

Here is the OpenBSD/FreeBSD definition for ETHER_HDR_LEN:
 #define ETHER_ADDR_LEN  6       /* Ethernet address length */
 #define ETHER_TYPE_LEN  2       /* Ethernet type field length */
 #define ETHER_HDR_LEN   ((ETHER_ADDR_LEN * 2) + ETHER_TYPE_LEN)

(OpenBSD's definition is at net/if_ether.h, FreeBSD's is at
 net/ethernet.h)

Linux definitions can be found at: net/ethernet.h
 #define ETHER_ADDR_LEN  ETH_ALEN  /* size of ethernet addr */
 #define ETHER_TYPE_LEN  2         /* bytes in type field */
 #define ETHER_HDR_LEN   ETH_HLEN  /* total octets in header */

net/if_ether.h:
 #define ETH_HLEN       14 /* Total octets in header.       */
 #define ETH_ALEN       6  /* Octets in one ethernet addr   */

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
isisd/isis_bpf.c