pfiles on Solaris 10 shows garbage IP_NEXTHOP value

August 4th, 2010

Discovered an interesting little bug today. On Solaris 10, if you run pfiles against a running process with TCP/IP sockets open, you might find IP_NEXTHOP present against every socket (even ones that didn’t set this flag):

# pfiles 1234
...
  10: S_IFSOCK mode:0666 dev:293,0 ino:64096 uid:0 gid:0 size:0
      O_RDWR
	SOCK_STREAM
	SO_REUSEADDR,SO_SNDBUF(1048576),SO_RCVBUF(1048576),IP_NEXTHOP(0.0.16.0)
	sockname: AF_INET 10.0.0.202  port: 1000
  11: S_IFSOCK mode:0666 dev:293,0 ino:34793 uid:0 gid:0 size:0
      O_RDWR
	SOCK_STREAM
	SO_REUSEADDR,SO_SNDBUF(1048576),SO_RCVBUF(1049800),IP_NEXTHOP(200.4.16.0)
	sockname: AF_INET 10.0.0.202  port: 1000
	peername: AF_INET 10.0.0.114  port: 49724
  12: S_IFSOCK mode:0666 dev:293,0 ino:49846 uid:0 gid:0 size:0
      O_RDWR
	SOCK_STREAM
	SO_SNDBUF(1048576),SO_RCVBUF(1055220),IP_NEXTHOP(244.25.16.0)
	sockname: AF_INET 10.0.0.114  port: 48161
  13: S_IFSOCK mode:0666 dev:293,0 ino:53776 uid:0 gid:0 size:0
      O_RDWR
	SOCK_STREAM
	SO_SNDBUF(1048576),SO_RCVBUF(1049800),IP_NEXTHOP(200.4.16.0)
	sockname: AF_INET 10.0.0.202  port: 48123
	peername: AF_INET 10.0.0.114  port: 1000
  14: S_IFSOCK mode:0666 dev:293,0 ino:17380 uid:0 gid:0 size:0
      O_RDWR
	SOCK_STREAM
	SO_SNDBUF(1048576),SO_RCVBUF(1049800),IP_NEXTHOP(200.4.16.0)
	sockname: AF_INET 10.0.0.202  port: 48148
	peername: AF_INET 10.0.0.116  port: 1000

This is related to bug 6386915 pfiles reports IP_NEXTHOP set when it isn’t. If you look closely at the list above, you’ll see that where the SO_RECVBUF values match, so do the IP_NEXTHOP values. Someone has gotten their C code wrong.

The bug was fixed in OpenSolaris/onnv but never backported to Solaris 10. If you need this fixed, just grab pfiles from an OpenSolaris box – it seems to work okay (But be sure to grab the platform binaries, eg /usr/bin/i86/pfiles and /usr/bin/amd64/pfiles). Also keep in mind the ABI interface between Solaris 10 and OpenSolaris may have changed so the pfiles binary from OpenSolaris might explode and eat your children. You have been warned. Worked for me though.

Entry Filed under: General

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed