2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-29 20:07:12 -07:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
2015-09-29 20:07:17 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
|
|
|
|
|
2015-09-29 20:07:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 06:12:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-06 19:12:52 -08:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-20 11:19:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 06:12:29 +03:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-09-10 12:09:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-10 12:10:02 -07:00
|
|
|
|
2017-01-10 14:37:35 -08:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-01-10 14:37:35 -08:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-06-06 20:50:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-06-06 20:50:38 -07:00
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-11 17:11:14 -07:00
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
2017-08-11 17:11:14 -07:00
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
2016-06-06 20:50:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:55 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 06:12:29 +03:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-19 06:12:29 +03:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-06 08:53:04 -08:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-06 08:53:04 -08:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-20 11:19:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
networking: make skb_push & __skb_push return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 14:29:23 +02:00
|
|
|
|
2017-03-20 11:19:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-14 14:31:11 -08:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-06 23:14:12 +02:00
|
|
|
|
2017-02-11 13:49:20 +02:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
|
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
|
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-17 10:42:42 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-04-07 11:10:06 -07:00
|
|
|
|
2016-05-04 21:46:12 -07:00
|
|
|
|
2017-08-11 17:11:14 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
2016-06-09 10:21:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-04 21:46:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-04 21:46:12 -07:00
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
2015-09-15 20:04:18 -05:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-14 14:31:11 -08:00
|
|
|
|
|
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-06 23:14:12 +02:00
|
|
|
|
|
|
|
|
|
2017-02-11 13:49:20 +02:00
|
|
|
|
2017-02-06 23:14:12 +02:00
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2015-10-07 16:48:47 -05:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-15 20:04:16 -05:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-15 20:04:16 -05:00
|
|
|
|
|
|
|
|
|
net: Add ethernet header for pass through VRF device
The change to use a custom dst broke tcpdump captures on the VRF device:
$ tcpdump -n -i vrf10
...
05:32:29.009362 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 21989, seq 1, length 64
05:32:29.009855 00:00:40:01:8d:36 > 45:00:00:54:d6:6f, ethertype Unknown (0x0a02), length 84:
0x0000: 0102 0a02 01fe 0000 9181 55e5 0001 bd11 ..........U.....
0x0010: da55 0000 0000 bb5d 0700 0000 0000 1011 .U.....]........
0x0020: 1213 1415 1617 1819 1a1b 1c1d 1e1f 2021 ...............!
0x0030: 2223 2425 2627 2829 2a2b 2c2d 2e2f 3031 "#$%&'()*+,-./01
0x0040: 3233 3435 3637 234567
Local packets going through the VRF device are missing an ethernet header.
Fix by adding one and then stripping it off before pushing back to the IP
stack. With this patch you get the expected dumps:
...
05:36:15.713944 IP 10.2.1.254 > 10.2.1.2: ICMP echo request, id 23795, seq 1, length 64
05:36:15.714160 IP 10.2.1.2 > 10.2.1.254: ICMP echo reply, id 23795, seq 1, length 64
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27 10:10:50 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-20 11:19:44 -07:00
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
2016-06-14 11:37:21 -07:00
|
|
|
|
|
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2015-09-02 13:58:35 -07:00
|
|
|
|
2017-08-11 17:11:14 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-05-04 21:46:12 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-05-04 21:46:12 -07:00
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
2016-04-07 11:10:06 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:47 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2015-11-24 14:29:16 +01:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-04-26 07:58:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-26 07:58:22 -07:00
|
|
|
|
2017-10-04 17:48:48 -07:00
|
|
|
|
2017-04-26 07:58:22 -07:00
|
|
|
|
2017-03-16 09:08:15 +01:00
|
|
|
|
2017-10-04 17:48:47 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-03-16 09:08:15 +01:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 09:08:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:46 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-10-04 17:48:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:47 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-05 08:51:24 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2015-08-18 20:28:03 +03:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2016-06-01 21:16:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-09 07:45:13 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-06-14 11:37:21 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-29 20:07:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-04 18:47:41 -07:00
|
|
|
|
|
|
|
|
|
2017-05-09 18:27:33 +08:00
|
|
|
|
2016-07-04 18:47:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 18:27:33 +08:00
|
|
|
|
2016-07-04 18:47:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
2016-10-16 20:02:52 -07:00
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-13 13:44:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-03 09:37:55 -08:00
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-20 11:19:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-13 13:44:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-04 18:47:41 -07:00
|
|
|
|
2016-06-06 20:50:40 -07:00
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-16 20:02:52 -07:00
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
2016-10-31 15:54:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-03 09:37:55 -08:00
|
|
|
|
|
|
|
|
|
2017-03-20 11:19:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
2016-07-04 18:47:41 -07:00
|
|
|
|
2016-06-06 20:50:39 -07:00
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-06-13 13:44:19 -07:00
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2016-06-13 13:44:19 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-13 13:44:19 -07:00
|
|
|
|
2016-05-13 12:23:45 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-29 20:07:12 -07:00
|
|
|
|
|
|
|
|
|
2016-05-10 11:19:50 -07:00
|
|
|
|
2016-09-10 12:09:55 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2016-09-10 12:09:56 -07:00
|
|
|
|
2015-10-12 11:47:09 -07:00
|
|
|
|
2015-09-29 20:07:12 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-09 10:21:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 10:57:15 -06:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-01 14:58:09 +00:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-16 09:48:24 -07:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-16 09:48:24 -07:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-31 15:54:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
2016-10-31 15:54:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-29 20:07:12 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
net: Fix inconsistent teardown and release of private netdev state.
Network devices can allocate reasources and private memory using
netdev_ops->ndo_init(). However, the release of these resources
can occur in one of two different places.
Either netdev_ops->ndo_uninit() or netdev->destructor().
The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.
netdev_ops->ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.
netdev->destructor(), on the other hand, does not run until the
netdev references all go away.
Further complicating the situation is that netdev->destructor()
almost universally does also a free_netdev().
This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.
If netdev_ops->ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
it is not able to invoke netdev->destructor().
This is because netdev->destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.
However, this means that the resources that would normally be released
by netdev->destructor() will not be.
Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.
Many drivers do not try to deal with this, and instead we have leaks.
Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev->destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().
netdev->priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev->destructor(), except for
free_netdev().
netdev->needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().
Now, register_netdevice() can sanely release all resources after
ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
and netdev->priv_destructor().
And at the end of unregister_netdevice(), we invoke
netdev->priv_destructor() and optionally call free_netdev().
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-08 12:52:56 -04:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-13 17:14:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-06-25 23:56:01 +02:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-06 15:24:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-25 23:55:59 +02:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-10 15:22:25 -08:00
|
|
|
|
2017-08-07 10:08:10 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2015-09-29 20:07:10 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
2016-06-08 10:55:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-02 07:43:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-02 07:43:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-05 08:51:24 -07:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
2015-08-18 20:28:04 +03:00
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-08 11:31:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-13 14:59:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|