~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/target/target.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-12-08 14:59:50 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071208145950-u1tykhpw56nyzqik
Tags: 5.4.1~dfsg-4ubuntu1
* Merge from debian unstable.
* Remaining Ubuntu changes:
  - Remove stop links from rc0 and rc6
  - Munge Maintainer field as per spec.
* Ubuntu changes dropped:
  - Symlink common files between the packages, CDBS ought to handle that
    for us automatically.
* The latest Debian changes has dropped history from the changelog. Slot in
  the Ubuntu changes as best I can. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
         * check tag list to see if we match 
62
62
         */
63
63
        if (targaddrs->tagList) {
 
64
            int matched = 0;
 
65
 
64
66
            /*
65
67
             * loop through tag list looking for requested tags 
66
68
             */
67
 
            for (cp = targaddrs->tagList; cp;) {
 
69
            for (cp = targaddrs->tagList; cp && !matched;) {
68
70
                cp = copy_nword(cp, buf, sizeof(buf));
69
 
                for (i = 0; i < numtags; i++) {
 
71
                for (i = 0; i < numtags && !matched; i++) {
70
72
                    if (strcmp(buf, tags[i]) == 0) {
71
73
                        /*
72
74
                         * found a valid target table entry 
100
102
                            continue;
101
103
                        }
102
104
 
 
105
                        /*
 
106
                         * Only one notification per TargetAddrEntry,
 
107
                         * rather than one per tag
 
108
                         */
 
109
                        matched = 1;
 
110
 
103
111
                        if (targaddrs->storageType != ST_READONLY &&
104
112
                            targaddrs->sess &&
105
113
                            param->updateTime >=
177
185
                                thissess.securityNameLen =
178
186
                                    strlen(thissess.securityName);
179
187
                                thissess.securityLevel = param->secLevel;
180
 
#if !defined(DISABLE_SNMPV1) || !defined(DISABLE_SNMPV2C)
 
188
                                thissess.securityModel = param->secModel;
 
189
#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
181
190
                            } else {
182
191
                                thissess.community =
183
192
                                    (u_char *) strdup(param->secName);
186
195
#endif
187
196
                            }
188
197
 
 
198
                            thissess.flags |= SNMP_FLAGS_DONT_PROBE;
189
199
                            targaddrs->sess = snmp_add(&thissess, t,
190
200
                                                       NULL, NULL);
 
201
                            thissess.flags &= ~SNMP_FLAGS_DONT_PROBE;
191
202
                            targaddrs->sessionCreationTime = time(NULL);
192
203
                        }
193
204
                        if (targaddrs->sess) {
195
206
                                targaddrs->sess->paramName =
196
207
                                    strdup(param->paramName);
197
208
 
198
 
                            if (ret) {
199
 
                                targaddrs->sess->next = ret;
200
 
                            }
 
209
                            targaddrs->sess->next = ret;
201
210
                            ret = targaddrs->sess;
202
211
                        } else {
203
212
                            snmp_sess_perror("target session", &thissess);