On Monday, May 7, 2018 9:38:22 AM HKT Linus Lüssing wrote:
include/uapi/linux/batadv_packet.h | 48 ++++++ net/batman-adv/distributed-arp-table.c | 296 +++++++++++++++++++++++++++++++++ net/batman-adv/distributed-arp-table.h | 11 ++ net/batman-adv/soft-interface.c | 11 +- 4 files changed, 364 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/batadv_packet.h b/include/uapi/linux/batadv_packet.h index 894d8d2f..7ef7b519 100644 --- a/include/uapi/linux/batadv_packet.h +++ b/include/uapi/linux/batadv_packet.h @@ -630,6 +630,54 @@ struct batadv_tvlv_mcast_data { __u8 reserved[3]; };
+enum batadv_bootpop {
BATADV_BOOTREQUEST = 1,
BATADV_BOOTREPLY = 2,
+};
+enum batadv_boothtype {
BATADV_HTYPE_ETHERNET = 1,
+};
+enum batadv_dhcpoptioncode {
BATADV_DHCP_OPT_PAD = 0,
BATADV_DHCP_OPT_MSG_TYPE = 53,
BATADV_DHCP_OPT_END = 255,
+};
+enum batadv_dhcptype {
BATADV_DHCPDISCOVER = 1,
BATADV_DHCPOFFER = 2,
BATADV_DHCPREQUEST = 3,
BATADV_DHCPDECLINE = 4,
BATADV_DHCPACK = 5,
BATADV_DHCPNAK = 6,
BATADV_DHCPRELEASE = 7,
BATADV_DHCPINFORM = 8,
+};
Can we shorten these definitions by only listing those that are used by the code below ?
@@ -1130,6 +1133,7 @@ batadv_dat_arp_create_reply(struct batadv_priv *bat_priv, __be32 ip_src, return NULL;
skb_reset_mac_header(skb);
skb_set_network_header(skb, ETH_HLEN); if (vid & BATADV_VLAN_HAS_TAG) skb = vlan_insert_tag(skb, htons(ETH_P_8021Q),
Might be better to move the skb_set_network_header() call into batadv_dat_put_pairs() where it is needed by skb_network_offset() ?
Cheers, Marek