Having gone through another round of find the incorrectly
configured RAS enable NT laptop, I have add a feature to
allow/deny granting of leases to a NT RAS request.  The code
based on dhcpv2.0b1pl25.  This feature is controlled in the
dhcpd.conf file via an allow/deny nt-ras statement.  The
default behavior is to allow servicing of NT RAS lease
requests.

Attached is the diff file to patch for this feature.

Regards

Dave
 

-- 

-----------------------------------------------------------
David Haddon                         [EMAIL PROTECTED]
System/Network Admin                 203.339.7861 (Voice)
IPC Information Systems              203.339.7087 (FAX)

If my employer had ANY opinions, they sure wouldn't be mine
-----------------------------------------------------------
 
*** ./common/conflex.c.orig     Tue Apr 13 09:37:04 1999
--- ./common/conflex.c  Tue Apr 13 09:37:54 1999
***************
*** 471,474 ****
--- 471,476 ----
                if (!strcasecmp (atom + 1, "ot"))
                        return TOKEN_NOT;
+               if (!strcasecmp (atom + 1, "t-ras"))
+                       return NT_RAS;
                break;
              case 'o':
*** ./includes/dhctoken.h.orig  Tue Apr 13 09:39:43 1999
--- ./includes/dhctoken.h       Mon Apr 12 10:52:50 1999
***************
*** 130,133 ****
--- 130,134 ----
  #define TOKEN_NOT     334
  #define ALWAYS_REPLY_RFC1048 335
+ #define NT_RAS          336
  
  #define is_identifier(x)      ((x) >= FIRST_TOKEN &&  \
*** ./includes/dhcpd.h.orig     Tue Apr 13 09:40:01 1999
--- ./includes/dhcpd.h  Mon Apr 12 10:53:46 1999
***************
*** 215,218 ****
--- 215,219 ----
        int authoritative;
        int always_reply_rfc1048;
+       int allow_nt_ras;
  
        struct tree_cache *options [256];
*** ./server/confpars.c.orig    Tue Apr 13 09:41:08 1999
--- ./server/confpars.c Mon Apr 12 10:57:43 1999
***************
*** 75,78 ****
--- 75,79 ----
        root_group.allow_booting = 1;
        root_group.authoritative = 1;
+       root_group.allow_nt_ras = 1;
  
        if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) {
***************
*** 438,442 ****
                        | BOOTING
                        | DYNAMIC_BOOTP
!                       | UNKNOWN_CLIENTS */
  
  void parse_allow_deny (cfile, group, flag)
--- 439,444 ----
                        | BOOTING
                        | DYNAMIC_BOOTP
!                       | UNKNOWN_CLIENTS 
!                       | NT_RAS */
  
  void parse_allow_deny (cfile, group, flag)
***************
*** 464,467 ****
--- 466,473 ----
              case UNKNOWN_CLIENTS:
                group -> boot_unknown_clients = flag;
+               break;
+ 
+             case NT_RAS:
+               group -> allow_nt_ras = flag;
                break;
  
*** ./server/dhcp.c.orig        Tue Apr 13 09:41:25 1999
--- ./server/dhcp.c     Tue Apr 13 09:45:49 1999
***************
*** 168,174 ****
        }
  
        /* If this subnet won't boot unknown clients, ignore the
           request. */
!       if (!lease -> host &&
            !lease -> subnet -> group -> boot_unknown_clients) {
                note ("Ignoring unknown client %s",
--- 168,190 ----
        }
  
+       /* If this subnet is to ignore NT RAS requests */
+       if (!lease -> host &&
+           !lease -> subnet -> group -> allow_nt_ras &&
+           packet -> raw ->hlen > 6  &&
+           packet -> raw -> chaddr[0] == 'R' &&
+           packet -> raw -> chaddr[1] == 'A' &&
+           packet -> raw -> chaddr[2] == 'S' &&
+           packet -> raw -> chaddr[3] == 0x20) {
+               note ("Ignoring NT RAS request: %s from %s",
+                     print_hw_addr (packet -> raw -> htype,
+                     packet -> raw -> hlen,
+                     packet -> raw -> chaddr),
+                     packet -> raw -> giaddr.s_addr
+                     ? inet_ntoa (packet -> raw -> giaddr)
+                     : packet -> interface -> name);
+ 
        /* If this subnet won't boot unknown clients, ignore the
           request. */
!       } else if (!lease -> host &&
            !lease -> subnet -> group -> boot_unknown_clients) {
                note ("Ignoring unknown client %s",
*** ./server/dhcpd.conf.5.orig  Tue Apr 13 09:43:22 1999
--- ./server/dhcpd.conf.5       Mon Apr 12 14:18:11 1999
***************
*** 470,473 ****
--- 470,484 ----
  \fBallow\fRed, but if it is disabled for a particular client, then
  that client will not be able to get and address from the DHCP server.
+ .PP
+ .B The
+ .I nt-ras
+ .B keyword
+ .PP
+  \fBallow nt-ras;\fR
+  \fBdeny nt-ras;\fR
+ .PP
+ The \fBnt-ras\fR flag is used to tell dhcpd whether or not to respond
+ to queries for a IP address from a NT RAS server.  By default, \fBnt-ras\fR is
+ \fBallow\fRed.
  .SH REFERENCE: PARAMETERS
  .PP

Reply via email to