File tree Expand file tree Collapse file tree 2 files changed +34
-33
lines changed Expand file tree Collapse file tree 2 files changed +34
-33
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,40 @@ static inline __be16 vlan_get_protocol(const struct sk_buff *skb)
310310
311311 return protocol ;
312312}
313+
314+ static inline void vlan_set_encap_proto (struct sk_buff * skb ,
315+ struct vlan_hdr * vhdr )
316+ {
317+ __be16 proto ;
318+ unsigned char * rawp ;
319+
320+ /*
321+ * Was a VLAN packet, grab the encapsulated protocol, which the layer
322+ * three protocols care about.
323+ */
324+
325+ proto = vhdr -> h_vlan_encapsulated_proto ;
326+ if (ntohs (proto ) >= 1536 ) {
327+ skb -> protocol = proto ;
328+ return ;
329+ }
330+
331+ rawp = skb -> data ;
332+ if (* (unsigned short * ) rawp == 0xFFFF )
333+ /*
334+ * This is a magic hack to spot IPX packets. Older Novell
335+ * breaks the protocol design and runs IPX over 802.3 without
336+ * an 802.2 LLC layer. We look for FFFF which isn't a used
337+ * 802.2 SSAP/DSAP. This won't work for fault tolerant netware
338+ * but does for the rest.
339+ */
340+ skb -> protocol = htons (ETH_P_802_3 );
341+ else
342+ /*
343+ * Real 802.2 LLC
344+ */
345+ skb -> protocol = htons (ETH_P_802_2 );
346+ }
313347#endif /* __KERNEL__ */
314348
315349/* VLAN IOCTLs are found in sockios.h */
Original file line number Diff line number Diff line change @@ -110,39 +110,6 @@ static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
110110 return skb ;
111111}
112112
113- static void vlan_set_encap_proto (struct sk_buff * skb , struct vlan_hdr * vhdr )
114- {
115- __be16 proto ;
116- unsigned char * rawp ;
117-
118- /*
119- * Was a VLAN packet, grab the encapsulated protocol, which the layer
120- * three protocols care about.
121- */
122-
123- proto = vhdr -> h_vlan_encapsulated_proto ;
124- if (ntohs (proto ) >= 1536 ) {
125- skb -> protocol = proto ;
126- return ;
127- }
128-
129- rawp = skb -> data ;
130- if (* (unsigned short * ) rawp == 0xFFFF )
131- /*
132- * This is a magic hack to spot IPX packets. Older Novell
133- * breaks the protocol design and runs IPX over 802.3 without
134- * an 802.2 LLC layer. We look for FFFF which isn't a used
135- * 802.2 SSAP/DSAP. This won't work for fault tolerant netware
136- * but does for the rest.
137- */
138- skb -> protocol = htons (ETH_P_802_3 );
139- else
140- /*
141- * Real 802.2 LLC
142- */
143- skb -> protocol = htons (ETH_P_802_2 );
144- }
145-
146113struct sk_buff * vlan_untag (struct sk_buff * skb )
147114{
148115 struct vlan_hdr * vhdr ;
You can’t perform that action at this time.
0 commit comments