summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_dhcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-root/check_dhcp.c')
-rw-r--r--plugins-root/check_dhcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index 2a1875c4..ac892747 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -839,8 +839,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
839 /* process all DHCP options present in the packet */ 839 /* process all DHCP options present in the packet */
840 for(x=4;x<MAX_DHCP_OPTIONS_LENGTH;){ 840 for(x=4;x<MAX_DHCP_OPTIONS_LENGTH;){
841 841
842 /* end of options (0 is really just a pad, but bail out anyway) */ 842 if((int)offer_packet->options[x]==-1)
843 if((int)offer_packet->options[x]==-1 || (int)offer_packet->options[x]==0)
844 break; 843 break;
845 844
846 /* get option type */ 845 /* get option type */
@@ -872,7 +871,9 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
872 } 871 }
873 872
874 /* skip option data we're ignoring */ 873 /* skip option data we're ignoring */
875 if(option_type!=DHCP_OPTION_REBINDING_TIME) 874 if(option_type==0) /* "pad" option, see RFC 2132 (3.1) */
875 x+=1;
876 else
876 x+=option_length; 877 x+=option_length;
877 } 878 }
878 879