Loading include/uapi/linux/net_map.h +3 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,8 @@ struct rmnet_map_header_s { #define RMNET_MAP_GET_LENGTH(Y) (ntohs( \ ((struct rmnet_map_header_s *)Y->data)->pkt_len)) #define RMNET_IP_VER_MASK 0xF0 #define RMNET_IPV4 0x40 #define RMNET_IPV6 0x60 #endif /* _NET_MAP_H_ */ net/core/flow_dissector.c +35 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <linux/if_pppox.h> #include <linux/ppp_defs.h> #include <net/flow_keys.h> #include <linux/net_map.h> /* copy saddr & daddr, possibly using 64bit load/store * Equivalent to : flow->src = iph->saddr; Loading Loading @@ -96,6 +97,40 @@ ipv6: return false; } } case __constant_htons(ETH_P_MAP): { struct { struct rmnet_map_header_s map; uint8_t proto; } *map, _map; unsigned int maplen; map = skb_header_pointer(skb, nhoff, sizeof(_map), &_map); if (!map) return false; /* Is MAP command? */ if (map->map.cd_bit) return false; /* Is aggregated frame? */ maplen = ntohs(map->map.pkt_len); maplen += map->map.pad_len; maplen += sizeof(struct rmnet_map_header_s); if (maplen < skb->len) return false; nhoff += sizeof(struct rmnet_map_header_s); switch (map->proto & RMNET_IP_VER_MASK) { case RMNET_IPV4: proto = htons(ETH_P_IP); goto ip; case RMNET_IPV6: proto = htons(ETH_P_IPV6); goto ipv6; default: return false; } } default: return false; } Loading Loading
include/uapi/linux/net_map.h +3 −0 Original line number Diff line number Diff line Loading @@ -23,5 +23,8 @@ struct rmnet_map_header_s { #define RMNET_MAP_GET_LENGTH(Y) (ntohs( \ ((struct rmnet_map_header_s *)Y->data)->pkt_len)) #define RMNET_IP_VER_MASK 0xF0 #define RMNET_IPV4 0x40 #define RMNET_IPV6 0x60 #endif /* _NET_MAP_H_ */
net/core/flow_dissector.c +35 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <linux/if_pppox.h> #include <linux/ppp_defs.h> #include <net/flow_keys.h> #include <linux/net_map.h> /* copy saddr & daddr, possibly using 64bit load/store * Equivalent to : flow->src = iph->saddr; Loading Loading @@ -96,6 +97,40 @@ ipv6: return false; } } case __constant_htons(ETH_P_MAP): { struct { struct rmnet_map_header_s map; uint8_t proto; } *map, _map; unsigned int maplen; map = skb_header_pointer(skb, nhoff, sizeof(_map), &_map); if (!map) return false; /* Is MAP command? */ if (map->map.cd_bit) return false; /* Is aggregated frame? */ maplen = ntohs(map->map.pkt_len); maplen += map->map.pad_len; maplen += sizeof(struct rmnet_map_header_s); if (maplen < skb->len) return false; nhoff += sizeof(struct rmnet_map_header_s); switch (map->proto & RMNET_IP_VER_MASK) { case RMNET_IPV4: proto = htons(ETH_P_IP); goto ip; case RMNET_IPV6: proto = htons(ETH_P_IPV6); goto ipv6; default: return false; } } default: return false; } Loading