Your message dated Sun, 18 Sep 2005 20:43:28 +0100
with message-id <[EMAIL PROTECTED]>
and subject line PF_INET, SOCK_PACKET replaced
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 5 May 2005 14:29:54 +0000
>From [EMAIL PROTECTED] Thu May 05 07:29:54 2005
Return-path: <[EMAIL PROTECTED]>
Received: from smtpq3.home.nl [213.51.128.198] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1DThMP-0008BT-00; Thu, 05 May 2005 07:29:54 -0700
Received: from [213.51.128.134] (port=40615 helo=smtp3.home.nl)
        by smtpq3.home.nl with esmtp (Exim 4.30)
        id 1DThMO-0006HQ-Gg; Thu, 05 May 2005 16:29:52 +0200
Received: from cc260354-a.hnglo1.ov.home.nl ([82.75.46.219]:47779 
helo=kars.perseus.home)
        by smtp3.home.nl with esmtp (Exim 4.30)
        id 1DThML-0007sL-Fh; Thu, 05 May 2005 16:29:49 +0200
Received: from kars by kars.perseus.home with local (Exim 3.36 #1 (Debian))
        id 1DThML-0006Mq-00; Thu, 05 May 2005 16:29:49 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Kars de Jong <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: rbootd: uses obsolete (PF_INET,SOCK_PACKET)
X-Mailer: reportbug 3.11
Date: Thu, 05 May 2005 16:29:49 +0200
Message-Id: <[EMAIL PROTECTED]>
Sender: Kars de Jong <[EMAIL PROTECTED]>
X-AtHome-MailScanner-Information: Neem contact op met [EMAIL PROTECTED] voor 
meer informatie
X-AtHome-MailScanner: Found to be clean
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: rbootd
Version: 2.0-6.1
Severity: normal

I got tired of seeing "kernel: rbootd uses obsolete 
(PF_INET,SOCK_PACKET)" entries in my syslog, so I decided to rewrite the 
packet sending code to use PF_PACKET instead. It uses SOCK_DGRAM to send 
IEEE 802.3 frames now.

Kars.

*** /tmp/rbootd.diff
diff -urN rbootd-2.0/debian/changelog rbootd-2.1/debian/changelog
--- rbootd-2.0/debian/changelog 2005-05-05 12:59:55.000000000 +0200
+++ rbootd-2.1/debian/changelog 2005-05-05 13:57:20.000000000 +0200
@@ -1,3 +1,9 @@
+rbootd (2.1-1) unstable; urgency=low
+
+  * Changed to use PF_PACKET socket instead of SOCK_PACKET
+
+ -- Kars de Jong <[EMAIL PROTECTED]>  Thu, 05 May 2005 13:56:17 +0200
+
 rbootd (2.0-6.1) unstable; urgency=low
 
   * Non maintainer upload
diff -urN rbootd-2.0/pcap.c rbootd-2.1/pcap.c
--- rbootd-2.0/pcap.c   1998-05-05 03:46:15.000000000 +0200
+++ rbootd-2.1/pcap.c   2005-05-05 13:52:11.000000000 +0200
@@ -27,7 +27,8 @@
 #include <unistd.h>                            /* close() */
 #include <syslog.h>                            /* syslog() */
 #include <net/if.h>                            /* struct ifreq */
-#include <linux/if_ether.h>                    /* ETH_P_ALL */
+#include <net/ethernet.h>                      /* ETH_P_802_3 */
+#include <netpacket/packet.h>                  /* PF_PACKET stuff */
 #include <string.h>                            /* strncpy(), bcopy() */
 #include "defs.h"
 
@@ -186,53 +187,46 @@
    * rconn->bootfd filedesc of open bootfile
    * rconn->next   ptr to next RMPCONN... 
    * 
-   * All we need to do is fill out source addr and send rconn->rmp. 
-   * This is all BpfWrite does, although there it's the BPF that does 
-   * the adding of source address.
-   * NOTE : we do *not* just set the source addr in the rconn we get given!
-   * We copy the old source addr and reset it, since code in rmpproto.c
-   * depends on the source address being the address of the *destination* 
-   * machine. (see the comment in rmp
-   *  
-   * Bits of this code borrowed from a post by 
-   * Jamie Lokier ([EMAIL PROTECTED]) giving source for a program that
-   * used SOCK_PACKET. Documentation on this facility is *really* rare...
+   * We use a PF_PACKET socket in IEEE 802.3 mode.
+   * All we need to do is fill out the destination addres and send rconn->rmp,
+   * skipping the Ethernet header (it will be filled in by the kernel).
    */ 
    int s,cs;
-   struct sockaddr sa;
-   char saveaddr[RMP_ADDRLEN];
-   
-   sa.sa_family = AF_INET;
-   strcpy (sa.sa_data, IntfName);
-   
-   s=socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL));
+   struct sockaddr_ll sa;
+
+   memset (&sa, 0, sizeof(sa));
+   s=socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_802_3));
    if (s == -1)
    {
       syslog(LOG_ERR, "attempt to open socket for write failed!");
       return 1;
    }
    
-   /* Get the source address for the packets. */
+   /* Get the interface index to be used. */
    {
       struct ifreq req;
       int status;
         
       strcpy (req.ifr_name, IntfName);
-      status = ioctl (s, SIOCGIFHWADDR, &req);
+      status = ioctl (s, SIOCGIFINDEX, &req);
       if (status == -1)
       {
-         syslog(LOG_ERR, "SIOCGIFHWADDR: couldn't get source address!");
+         syslog(LOG_ERR, "SIOCGIFINDEX: couldn't get interface index!");
          return 0;
       }
-      /* save old source addr, then write real source addr into packet */
-      memcpy (saveaddr, &(rconn->rmp.hp_hdr.saddr), RMP_ADDRLEN);
-      memcpy (&(rconn->rmp.hp_hdr.saddr), req.ifr_hwaddr.sa_data, RMP_ADDRLEN);
+      sa.sll_ifindex = req.ifr_ifindex;
    }
-   /* perform the actual raw packet send */
-   cs = sendto(s, &(rconn->rmp), rconn->rmplen, 0, &sa, sizeof(sa));       
 
-   /* restore previous contents of the source address field before return */
-   memcpy  (&(rconn->rmp.hp_hdr.saddr),saveaddr, RMP_ADDRLEN);
+   /* Fill in the socket address */
+   sa.sll_protocol = htons(ETH_P_802_3);
+   sa.sll_family = AF_PACKET;
+   memcpy (&sa.sll_addr, &(rconn->rmp.hp_hdr.daddr), RMP_ADDRLEN);
+   sa.sll_halen = RMP_ADDRLEN;
+
+   /* perform the actual packet send */
+   cs = sendto(s, &(rconn->rmp.hp_llc), rconn->rmplen - sizeof(struct hp_hdr),
+              0, (struct sockaddr *)&sa, sizeof(sa));
+
    close (s);
 
    if (cs == -1)


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-1.14_FC3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages rbootd depends on:
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an
ii  libpcap0.7                  0.7.2-7      System interface for user-level pa
ii  netbase                     4.21         Basic TCP/IP networking system

-- no debconf information

---------------------------------------
Received: (at 307793-done) by bugs.debian.org; 18 Sep 2005 19:43:30 +0000
>From [EMAIL PROTECTED] Sun Sep 18 12:43:30 2005
Return-path: <[EMAIL PROTECTED]>
Received: from chiark.greenend.org.uk [193.201.200.170] (mail)
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1EH54T-000672-00; Sun, 18 Sep 2005 12:43:30 -0700
Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local-esmtp
        (return-path [EMAIL PROTECTED])
        id 1EH54S-0003mX-00
        for [EMAIL PROTECTED]; Sun, 18 Sep 2005 20:43:28 +0100
To: [EMAIL PROTECTED]
Subject: PF_INET, SOCK_PACKET replaced
Date: Sun, 18 Sep 2005 20:43:28 +0100
From: Alan Bain <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-1.5 required=4.0 tests=BAYES_10 autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02

Rbootd as of 2.0-7 has been upgraded to use PF_PACKET.  Thanks 
for your patch,

Alan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to