-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
57 lines (51 loc) · 2.66 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Chain Debug Module
This little Linux kernel module gives you the ability to debug kernel "chain"
events from the networking subsystem. It enables the appropriate hooks by
checking if the chains were enabled in the kernel config.
It can be quite helpful if you need to trace various events and see what is
generated.
The currently supported chains are:
- netdev_chain
- inetaddr_chain
- inet6addr_chain
Chaindbg will print additional helpful information related to the event.
Installation:
# make && make install
# modprobe chaindbg
Now you should be able to see this in your dmesg:
[699499.715416] CHAINDBG loading
[699499.715422] C: NETDEV DEV: lo EVENT: NETDEV_REGISTER (0x5)
[699499.715423] C: NETDEV DEV: lo EVENT: NETDEV_UP (0x1)
...
Removal:
# rmmod chaindbg
You should see this in your dmesg:
[699497.665141] CHAINDBG unloading
[699497.665148] C: NETDEV DEV: lo EVENT: NETDEV_GOING_DOWN (0x9)
[699497.665150] C: NETDEV DEV: lo EVENT: NETDEV_DOWN (0x2)
[699497.665151] C: NETDEV DEV: lo EVENT: NETDEV_UNREGISTER (0x6)
[699497.665153] C: NETDEV DEV: lo EVENT: NETDEV_UNREGISTER_FINAL (0x11)
Example output:
These events are triggered by various interface manipulations done with
ifconfig.
[694896.024079] C: NETDEV DEV: em1.500 EVENT: NETDEV_REGISTER (0x5)
[694896.024080] C: NETDEV DEV: em1.500 EVENT: NETDEV_UP (0x1)
[694942.131049] C: NETDEV DEV: em1.500 EVENT: NETDEV_CHANGEADDR (0x8) MAC: 00:11:22:33:44:55
[696457.016389] C: NETDEV DEV: em1.500 EVENT: NETDEV_GOING_DOWN (0x9)
[696457.020609] C: NETDEV DEV: em1.500 EVENT: NETDEV_DOWN (0x2)
# ifconfig em1.500 192.168.50.2
First it removes the old IP address (192.168.50.1)
[693029.167595] C: INETADDR DEV: em1.500 EVENT: NETDEV_DOWN (0x2) ADDR: 192.168.50.1
Then it adds the new one
[693029.167632] C: INETADDR DEV: em1.500 EVENT: NETDEV_UP (0x1) ADDR: 192.168.50.2
[693029.168826] C: INETADDR DEV: em1.500 EVENT: NETDEV_DOWN (0x2) ADDR: 192.168.50.2
[693029.168850] C: INETADDR DEV: em1.500 EVENT: NETDEV_UP (0x1) ADDR: 192.168.50.2
# ethtool -K em1.500 gso off
[ 1420.571126] C: NETDEV DEV: em1.500 EVENT: NETDEV_FEAT_CHANGE (0xb) FEATURES: (0x20115029) tx-scatter-gather tx-checksum-ip-generic highdma tx-lockless rx-gro tx-tcp-segmentation tx-tcp6-segmentation rx-checksum
# ifconfig em1.500 -multicast
[ 1687.019506] C: NETDEV DEV: em1.500 EVENT: NETDEV_CHANGE (0x4) FLAGS: (0x3) IFF_UP IFF_BROADCAST
# ifconfig em1.500 hw ether 00:11:22:33:44:55
[694942.131049] C: NETDEV DEV: em1.500 EVENT: NETDEV_CHANGEADDR (0x8) MAC: 00:11:22:33:44:55
# ifconfig em1.500 mtu 1400
[699512.262366] C: NETDEV DEV: em1.500 EVENT: NETDEV_CHANGEMTU (0x7) MTU: 1400
Author: Nikolay Aleksandrov (nik@BlackWall.org)