Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ip_addr] Match on a substring of interface name when looking for mas… #222

Merged
merged 1 commit into from
Apr 4, 2019

Conversation

ptalbert
Copy link
Collaborator

…ter interfaces

The current logic in the -i output to match bridge port interfaces
does not work if the port is a vlan with a name in the style
"interface@physdev". So instead match on everything up to the
ampersand symbol.

Signed-off-by: Patrick Talbert ptalbert@redhat.com

@ptalbert
Copy link
Collaborator Author

Doh. I need to add i_substr to the local vars of IPADDR().

Or don't declare i_substr at all and shove the expression match directly the slave check?

Also also, surely a problem for another time, but it may be safer to get the interface names from /sys/class/net/ , no? It would have avoided this problem, at least..

@ryran
Copy link
Owner

ryran commented Jun 14, 2018

@ptalbert

Hey! Can you email me some ip addr output that demonstrates this? I totally trust your judgement here, as you obviously use this way more than me and see way more exotic hardware, but I'd just like to better understand what's going on and am too tired/stupid right now to parse your explanation. :)

@ptalbert
Copy link
Collaborator Author

Sure, here is an example from RHEL 5.11:

$ cat sos_commands/networking/ip_address 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 52:54:00:5f:5a:1f brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.249/24 brd 192.168.122.255 scope global eth0
    inet6 fe80::5054:ff:fe5f:5a1f/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0: <NOARP> mtu 1480 qdisc noop 
    link/sit 0.0.0.0 brd 0.0.0.0
4: eth0.123@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop 
    link/ether 52:54:00:5f:5a:1f brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop 
    link/ether 52:54:00:5f:5a:1f brd ff:ff:ff:ff:ff:ff

$ cat sos_commands/networking/brctl_show 
bridge name	bridge id		STP enabled	interfaces
br0		8000.5254005f5a1f	no		eth0.123

$ xsos -i .
IP4
  Interface      Master IF  MAC Address        MTU     State  IPv4 Address
  =========      =========  =================  ======  =====  ==================
  lo             -          -                  16436   up     127.0.0.1/8
  eth0           -          52:54:00:5f:5a:1f  1500    up     192.168.122.249/24
  eth0.123@eth0  -          52:54:00:5f:5a:1f  1500    DOWN   -
  br0            -          52:54:00:5f:5a:1f  1500    DOWN   -

@ryran
Copy link
Owner

ryran commented Apr 3, 2019

@ptalbert

Hey Patrick! If you've tested this, feel free to merge.

…ter interfaces

The current logic in the -i output to match bridge port interfaces
does not work if the port is a vlan with a name in the style
"interface@physdev". So instead match on everything up to the
ampersand symbol.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
@ptalbert ptalbert merged commit 22fcbb0 into ryran:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants