|
93 | 93 |
|
94 | 94 | /* |
95 | 95 | Assumptions: |
96 | | - - If the device has no dev->header_ops, there is no LL header visible |
97 | | - above the device. In this case, its hard_header_len should be 0. |
| 96 | + - If the device has no dev->header_ops->create, there is no LL header |
| 97 | + visible above the device. In this case, its hard_header_len should be 0. |
98 | 98 | The device may prepend its own header internally. In this case, its |
99 | 99 | needed_headroom should be set to the space needed for it to add its |
100 | 100 | internal header. |
|
108 | 108 | On receive: |
109 | 109 | ----------- |
110 | 110 |
|
111 | | -Incoming, dev->header_ops != NULL |
| 111 | +Incoming, dev_has_header(dev) == true |
112 | 112 | mac_header -> ll header |
113 | 113 | data -> data |
114 | 114 |
|
115 | | -Outgoing, dev->header_ops != NULL |
| 115 | +Outgoing, dev_has_header(dev) == true |
116 | 116 | mac_header -> ll header |
117 | 117 | data -> ll header |
118 | 118 |
|
119 | | -Incoming, dev->header_ops == NULL |
| 119 | +Incoming, dev_has_header(dev) == false |
120 | 120 | mac_header -> data |
121 | 121 | However drivers often make it point to the ll header. |
122 | 122 | This is incorrect because the ll header should be invisible to us. |
123 | 123 | data -> data |
124 | 124 |
|
125 | | -Outgoing, dev->header_ops == NULL |
| 125 | +Outgoing, dev_has_header(dev) == false |
126 | 126 | mac_header -> data. ll header is invisible to us. |
127 | 127 | data -> data |
128 | 128 |
|
129 | 129 | Resume |
130 | | - If dev->header_ops == NULL we are unable to restore the ll header, |
| 130 | + If dev_has_header(dev) == false we are unable to restore the ll header, |
131 | 131 | because it is invisible to us. |
132 | 132 |
|
133 | 133 |
|
@@ -2069,7 +2069,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, |
2069 | 2069 |
|
2070 | 2070 | skb->dev = dev; |
2071 | 2071 |
|
2072 | | - if (dev->header_ops) { |
| 2072 | + if (dev_has_header(dev)) { |
2073 | 2073 | /* The device has an explicit notion of ll header, |
2074 | 2074 | * exported to higher levels. |
2075 | 2075 | * |
@@ -2198,7 +2198,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, |
2198 | 2198 | if (!net_eq(dev_net(dev), sock_net(sk))) |
2199 | 2199 | goto drop; |
2200 | 2200 |
|
2201 | | - if (dev->header_ops) { |
| 2201 | + if (dev_has_header(dev)) { |
2202 | 2202 | if (sk->sk_type != SOCK_DGRAM) |
2203 | 2203 | skb_push(skb, skb->data - skb_mac_header(skb)); |
2204 | 2204 | else if (skb->pkt_type == PACKET_OUTGOING) { |
|
0 commit comments