Skip to content

Commit

Permalink
Include all interface types from RFC 3635
Browse files Browse the repository at this point in the history
Because:

- Although RFC 3635 specifies that implementations MUST use
  ifType=ethernetCsmacd(6) for all ethernet-like interface types, many
  fielded implementations have incorrectly used other values that were
  never reserved by the IETF.
- D-Link is one such vendor, where interfaces would not be listed in the
  room interface list because of this.

Fixes Uninett#2280
  • Loading branch information
lunkwill42 committed Oct 19, 2021
1 parent e406cc8 commit cdb77b3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/nav/web/info/room/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
RACK_CENTER: 'center',
RACK_RIGHT: 'right',
}
# See section 3.2.4 of RFC 3635:
ETHERNET_INTERFACE_TYPES = (
6, # ethernetCsmacd
62, # fastEther
69, # fastEtherFX
117, # gigabitEthernet
)

_logger = logging.getLogger('nav.web.info.room')

Expand Down Expand Up @@ -217,7 +224,7 @@ def render_netboxes(request, roomid):
# Filter interfaces on iftype and add fast last_cam lookup
for netbox in netboxes:
netbox.interfaces = (
netbox.interface_set.filter(iftype=6)
netbox.interface_set.filter(iftype__in=ETHERNET_INTERFACE_TYPES)
.order_by("ifindex")
.extra(select=cam_query)
)
Expand Down

0 comments on commit cdb77b3

Please sign in to comment.