bugGNU Networking Utilities - Bugs: bug #37252, Use IPPROTO_ICMP socket type...

 
 

bug #37252: Use IPPROTO_ICMP socket type instead of raw sockets, if available

Submitter:  None
Submitted:  Sun 02 Sep 2012 01:46:19 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 07 Sep 2024 05:53:38 PM UTC, comment #3: 

I'd say that the summary line is no longer accurate, because the IPv4 ping program uses SOCK_DGRAM with IPPROTO_ICMP and thus does not require raw sockets since 2016.

That said, this support is incomplete (ping6 still requires raw sockets) and buggy (ping treats the data read from an ICMP datagram socket as if came from an IPv4 raw socket, but this is incorrect).

I have created two new bug reports:


I am closing this bug.

Erik Auerswald <auerswal>
Group Member
Tue 04 Sep 2012 04:20:42 AM UTC, comment #2: 

It does, but like this:


 proto = getprotobyname ("icmp");
  if (!proto)
    {
      fprintf (stderr, "ping: unknown protocol icmp.\n");
      return NULL;
    }

  fd = socket (AF_INET, SOCK_RAW, proto->p_proto);

What the goal would be is to have it look like this:

fd = socket (AF_INET, SOCK_DGRAM, proto->p_proto)

Also, some of the values currently handled by ping will need to be passed as socket options.

Btw, reference is here:

http://lwn.net/Articles/443051/

Anonymous
Mon 03 Sep 2012 08:21:29 AM UTC, comment #1: 

Doesn't recent inetutils use IPPROTO_ICMP?  I see some uses of IPPROTO_ICMP in there.

Generally I would +1 anything that leads to removing setuid bits.

Simon Josefsson <jas>
Group administrator
Sun 02 Sep 2012 01:46:19 AM UTC, original submission:  

This socket type has been available since last year. While not enabled by default, it would be excellent to integrate this into inetutils if it is available.

Long term, would it make sense to move to this so as to avoid setuid on a basic utility?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by auerswal (Posted a comment)
  • -email is unavailable- added by jas (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-09-07 auerswal Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code