aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_in.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25/ax25_in.c')
-rw-r--r--net/ax25/ax25_in.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 4a6b26becadc..0ddaff0df217 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -61,12 +61,14 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
61 skb_reserve(skbn, AX25_MAX_HEADER_LEN); 61 skb_reserve(skbn, AX25_MAX_HEADER_LEN);
62 62
63 skbn->dev = ax25->ax25_dev->dev; 63 skbn->dev = ax25->ax25_dev->dev;
64 skbn->h.raw = skbn->data; 64 skb_reset_network_header(skbn);
65 skbn->nh.raw = skbn->data; 65 skb_reset_transport_header(skbn);
66 66
67 /* Copy data from the fragments */ 67 /* Copy data from the fragments */
68 while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) { 68 while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) {
69 memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len); 69 skb_copy_from_linear_data(skbo,
70 skb_put(skbn, skbo->len),
71 skbo->len);
70 kfree_skb(skbo); 72 kfree_skb(skbo);
71 } 73 }
72 74
@@ -122,8 +124,8 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
122 } 124 }
123 125
124 skb_pull(skb, 1); /* Remove PID */ 126 skb_pull(skb, 1); /* Remove PID */
125 skb->mac.raw = skb->nh.raw; 127 skb_reset_mac_header(skb);
126 skb->nh.raw = skb->data; 128 skb_reset_network_header(skb);
127 skb->dev = ax25->ax25_dev->dev; 129 skb->dev = ax25->ax25_dev->dev;
128 skb->pkt_type = PACKET_HOST; 130 skb->pkt_type = PACKET_HOST;
129 skb->protocol = htons(ETH_P_IP); 131 skb->protocol = htons(ETH_P_IP);
@@ -196,7 +198,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
196 * Process the AX.25/LAPB frame. 198 * Process the AX.25/LAPB frame.
197 */ 199 */
198 200
199 skb->h.raw = skb->data; 201 skb_reset_transport_header(skb);
200 202
201 if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) { 203 if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
202 kfree_skb(skb); 204 kfree_skb(skb);
@@ -233,7 +235,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
233 235
234 /* UI frame - bypass LAPB processing */ 236 /* UI frame - bypass LAPB processing */
235 if ((*skb->data & ~0x10) == AX25_UI && dp.lastrepeat + 1 == dp.ndigi) { 237 if ((*skb->data & ~0x10) == AX25_UI && dp.lastrepeat + 1 == dp.ndigi) {
236 skb->h.raw = skb->data + 2; /* skip control and pid */ 238 skb_set_transport_header(skb, 2); /* skip control and pid */
237 239
238 ax25_send_to_raw(&dest, skb, skb->data[1]); 240 ax25_send_to_raw(&dest, skb, skb->data[1]);
239 241
@@ -246,8 +248,8 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
246 switch (skb->data[1]) { 248 switch (skb->data[1]) {
247 case AX25_P_IP: 249 case AX25_P_IP:
248 skb_pull(skb,2); /* drop PID/CTRL */ 250 skb_pull(skb,2); /* drop PID/CTRL */
249 skb->h.raw = skb->data; 251 skb_reset_transport_header(skb);
250 skb->nh.raw = skb->data; 252 skb_reset_network_header(skb);
251 skb->dev = dev; 253 skb->dev = dev;
252 skb->pkt_type = PACKET_HOST; 254 skb->pkt_type = PACKET_HOST;
253 skb->protocol = htons(ETH_P_IP); 255 skb->protocol = htons(ETH_P_IP);
@@ -256,8 +258,8 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
256 258
257 case AX25_P_ARP: 259 case AX25_P_ARP:
258 skb_pull(skb,2); 260 skb_pull(skb,2);
259 skb->h.raw = skb->data; 261 skb_reset_transport_header(skb);
260 skb->nh.raw = skb->data; 262 skb_reset_network_header(skb);
261 skb->dev = dev; 263 skb->dev = dev;
262 skb->pkt_type = PACKET_HOST; 264 skb->pkt_type = PACKET_HOST;
263 skb->protocol = htons(ETH_P_ARP); 265 skb->protocol = htons(ETH_P_ARP);